home *** CD-ROM | disk | FTP | other *** search
- 'To run TEST.BAS:
- 'create BARMENU.QLB - run BARQLB.BAT
- 'Start QB like so; QB TEST /L BARMENU <enter>
-
- '$INCLUDE: 'BARMENU.BI' 'Declares COMMON BLOCK variables.
- 'Add to the list if you need more variables
- 'that have the COMMON SHARED attribute.
- DIM SSA%(9999) 'Screen Save Array
- '5 screen saves available @ 2000 words per
- 'screen. You can make bigger or smaller
- 'depending on your needs. The next two
- 'dim statements are adjusted (according to
- 'the size of SSA%) for you.
- DIM CY%(UBOUND(SSA%) \ 2000) 'Cursor Y position save/restore array.
- DIM CX%(UBOUND(SSA%) \ 2000) 'Cursor X position save/restore array.
-
- DEFINT M, S 'Integers Menu and Selection
-
- Video 'a call to Video should be one of the first things you do.
- Saveit 'NEVER call SaveIt (or RestoreIt) before you have called Video
-
- VIEW PRINT 1 TO 25
- CLS
-
- 'Do NOT call bar if you have used VIEW PRINT to exclude printing on a
- 'line it needs! To do so will yield an ERROR, of the Illegal Function
- 'Call variety. If you use VIEW PRINT, set it before the call to BAR and
- 'again afterwards, like so:
- ' VIEW PRINT 10 TO 20
- ' .
- ' .
- ' .
- ' VIEW PRINT 1 TO 25
- ' CALL BAR(Menu%, Selection%)
- ' VIEW PRINT 10 TO 20
- ' ...
- 'If this becomes an inconvenience, you may want to use CURSOR.OBJ,
- 'distributed with BMW.EXE. It makes two BIOS calls, and may be a tad
- 'slower than LOCATE. See the description of CURSOR.OBJ in BMW.DOC.
- '
- 'BAR may be called with Integers Menu and Selection set to valid values.
- 'This will cause BAR to drop the appropriate menu and place the Selection
- 'bar on the appropriate menu item. If a divide bar is in a drop menu, you
- 'count it when determining a valid selection number. For example, if a
- 'divide bar separates menu item three from menu item 2, and you want menu
- 'item 3 to be 'on' when you call BAR, then assign Selection the value of 4.
- 'The value 3 would be invalid, and BAR will use the default of 1.
- 'When BAR is called with Selection valid, and Menu = 0, BAR will use
- 'a default of 1 for Menu, drop the first menu, and the menu bar will
- 'highlight the appropriate menu selection.
-
- 'BAR may be called with Integer Menu valid, and Selection = 0. In this
- 'case, BAR will be prepared to drop the appropriate menu when the Enter key
- 'is hit.
-
- 'If you call BAR with Menu = 0, and Selection = a valid value, BAR will use
- 'a default of 1 for Menu and drop menu #1, with the selection bar on the
- 'appropriate item.
-
- 'Whenever Integers Menu and Selection = 0, BAR uses the default
- 'values of 1 for Menu and Selection. A menu will not drop, however, until
- 'the enter key is hit.
-
- 'You can of course call BAR with two integers named whatever you wish. Just
- 'make sure they are integers! I mean integers%....(!)
- 'The following will work.
- 'CALL BAR(Fred%, Sam%) 'Specify integers and you can't go wrong
- 'or
- 'DEFINT D, E 'Variable Declaration Dwhatever and Ewhatever are
- 'CALL BAR(Damaris, Edith) 'integers.
- 'If you call BAR with other than integer variables, you'll get inconclusive
- 'results, strange things may happen, and you might even crash.
- '
- 'SaveIt and RestorIt:
- 'Never call SaveIt or RestoreIt before you have called Video.
- 'The Screen and Cursor position are saved in three arrays. A pointer keeps
- 'track of these arrays.
- 'Do not call RestoreIt unless a previous call to SaveIt has been done.
- 'Do not call SaveIt more times than than the array sizes will allow.
- 'SAMPLE:
- 'Call Video
- '.
- '.
- '. "Array pointer (AP%) = 0
- 'SaveIt "Array pointer (AP%) = 1 after call
- '│ .
- '│ .
- '│ .
- '│ SaveIt "Array pointer (AP%) = 2 after call
- '│ │ .
- '│ │ .
- '│ │ .
- '│ │ SaveIt "Array pointer (AP%) = 3 after call
- '│ │ │ .
- '│ │ │ .
- '│ │ │ .
- '│ │ RestoreIt "Array pointer (AP%) = 2 after call
- '│ │ .
- '│ │ .
- '│ │ .
- '│ RestoreIt "Array pointer (AP%) = 1 after call
- '│ .
- '│ .
- '│ .
- 'RestoreIt "Array pointer (AP%) = 0 after call
- 'Don't call RestoreIt if AP% = 0
- FillScreen$ = STRING$(2000, "░")
- CALL Aprint(FillScreen$, NormalText%)
- Menu = 0
- Selection = 0
- CallBar:
- Saveit
- LOCATE 10, 30
- PRINT "Before call to BAR:";
- LOCATE 11, 30
- PRINT "Integer Menu ="; Menu
- LOCATE 12, 30
- PRINT "Integer Selection ="; Selection;
-
- CALL Bar(Menu, Selection)
- LOCATE 13, 30
- PRINT "BARMENU RETURNS:";
- LOCATE 14, 30
- PRINT "Integer Menu ="; Menu;
- LOCATE 15, 30
- PRINT "Integer Selection ="; Selection;
- LOCATE 17, 30
- PRINT "Would you like to call BAR again? (y or n)";
-
- GA:
- Answer$ = ""
- WHILE Answer$ = ""
- Answer$ = INKEY$
- WEND
- IF LCASE$(Answer$) = "n" THEN
- RestoreIt
- END
- ELSEIF LCASE$(Answer$) = "y" THEN
- RestoreIt
- GOTO CallBar
- ELSE
- SOUND 350, 1.6: SOUND 250, .8: SOUND 150, .5
- GOTO GA
- END IF
-
-
-
-
-
-
-
-
-